Excel 2019 Power Programming with VBA by Michael Alexander & Dick Kusleika

Excel 2019 Power Programming with VBA by Michael Alexander & Dick Kusleika

Author:Michael Alexander & Dick Kusleika
Language: eng
Format: epub
ISBN: 9781119514916
Publisher: Wiley
Published: 2019-05-14T00:00:00+00:00


This procedure displays a message whenever the chart is activated.

The Chart_Deactivate procedure that follows also displays a message, but only when the chart sheet is deactivated:

Private Sub Chart_Deactivate() Dim msg As String msg = "Thanks for viewing the chart." MsgBox msg, , ActiveWorkbook.Name End Sub

The Chart_Select procedure that follows is executed whenever an item on the chart is selected:

Private Sub Chart_Select(ByVal ElementID As Long, _ ByVal Arg1 As Long, ByVal Arg2 As Long) Dim Id As String Select Case ElementID Case xlAxis: Id = "Axis" Case xlAxisTitle: Id = "AxisTitle" Case xlChartArea: Id = "ChartArea" Case xlChartTitle: Id = "ChartTitle" Case xlCorners: Id = "Corners" Case xlDataLabel: Id = "DataLabel" Case xlDataTable: Id = "DataTable" Case xlDownBars: Id = "DownBars" Case xlDropLines: Id = "DropLines" Case xlErrorBars: Id = "ErrorBars" Case xlFloor: Id = "Floor" Case xlHiLoLines: Id = "HiLoLines" Case xlLegend: Id = "Legend" Case xlLegendEntry: Id = "LegendEntry" Case xlLegendKey: Id = "LegendKey" Case xlMajorGridlines: Id = "MajorGridlines" Case xlMinorGridlines: Id = "MinorGridlines" Case xlNothing: Id = "Nothing" Case xlPlotArea: Id = "PlotArea" Case xlRadarAxisLabels: Id = "RadarAxisLabels" Case xlSeries: Id = "Series" Case xlSeriesLines: Id = "SeriesLines" Case xlShape: Id = "Shape" Case xlTrendline: Id = "Trendline" Case xlUpBars: Id = "UpBars" Case xlWalls: Id = "Walls" Case xlXErrorBars: Id = "XErrorBars" Case xlYErrorBars: Id = "YErrorBars" Case Else:: Id = "Some unknown thing" End Select MsgBox "Selection type:" & Id & vbCrLf & Arg1 & vbCrLf & Arg2 End Sub



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.